package org.hilo.boot.core;

import org.slf4j.LoggerFactory;
import org.springframework.context.annotation.Condition;
import org.springframework.context.annotation.ConditionContext;
import org.springframework.core.type.AnnotatedTypeMetadata;

/**
 * 暂时未使用，可删除
 * 
 * Spring Bean @Conditional，判断是否启用PerformanceInterceptor
 */
public class PerformanceInterceptorCondition implements Condition {

    // 用法： @Conditional({PerformanceInterceptorCondition.class})
    @Override
    public boolean matches(ConditionContext context, AnnotatedTypeMetadata metadata) {
        return LoggerFactory.getLogger(PerformanceInterceptor.class).isDebugEnabled();
    }

}
